function* helloWorldGenerator() {
  yield 'hello';
  yield 'world';
  return 'ending';
}

var hw = helloWorldGenerator();


for(let i of hw){
  console.log(i)
}

console.log(hw.next())
console.log(hw.next())
console.log(hw.next())
console.log(hw.next())

